﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tema_inginerie
{
    public class Program
    {
        public static void Main(string[] args)
        {

            AbstractFactory factory = new CarFactory();
              CarPool _pool = CarPool.getInstance();
              List<Client> lista_masini = new List<Client>();
            
                Console.WriteLine("Introduceti numele utilizatorului si varsta.\n");
                string numeUtilizator = Console.ReadLine();
                
                int varsta = Int32.Parse(Console.ReadLine());
                while (true)
                {

                    Console.WriteLine("Introduceti numele masinii.Tastati exit pentru a iesi");
                    string numeMasina = Console.ReadLine();
                    if (numeMasina.Equals("exit")) break;
                    Console.WriteLine("Alegeti tipul masinii:\n1.Sedan\n2.Coupe\n3.Mini\n");
                    string tipMasina = Console.ReadLine();



                    Client client = new Client(factory, tipMasina, numeMasina, numeUtilizator, varsta);
                    client.init();
                    _pool.AddObj(client.get_car());
                    Console.WriteLine("Numarul de elemente in pool:" + _pool.CurrentObjectsInPool);
                    
                 
                }
            /*
             //stergere element din pool
             
                Console.WriteLine("Introduceti numele masinii ce se vrea eliminata din pool:\n");
                string sterge = Console.ReadLine();
                for (int i = 0; i < lista_masini.Count; i++)
                  if( lista_masini[i].get_car().get_numeMasina().Equals(sterge)) _pool.ReleaseObject(lista_masini[i].get_car());
                Console.WriteLine("Numarul de masini in pool:" + _pool.CurrentObjectsInPool + "\n");
           
        */
        }
         
    }
}
